import request from "@/utils/request";
import { parseStrEmpty } from "@/utils/ruoyi";


// 查询用户个人信息
export function getUserProfile() {
  return request({
    url: "/system/profile",
    method: "get",
  });
}

// 修改用户个人信息
export function updateUserProfile(data) {
  return request({
    url: "/system/profile",
    method: "put",
    data: data,
  });
}

// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
  const data = {
    oldPassword,
    newPassword,
  };
  return request({
    url: "/system/profile/pwd",
    method: "put",
    data,
  });
}

// 用户头像上传
export function uploadAvatar(data) {
  return request({
    url: "/system/profile/avatar",
    method: "post",
    data: data,
  });
}
